public class StaticProxy {
    public static void main(String[] args) {
//        Weddingcompany target = new Weddingcompany(new You());
//        target.happyMarriage();
        TestLambda testLambda = new TestLambda();
        testLambda.main();
    }
    interface Marry{
        //人生四大喜事
        // 1.久旱逢甘露
        //2.他乡遇故知
        //3.洞房花烛夜
        //4. 金榜题名时
        void happyMarriage();

    };

    static class You implements Marry{
        @Override
        public void happyMarriage(){
            System.out.println("结婚");
        }
    }
    //代理角色
     static class Weddingcompany implements Marry{
        private Marry target;
        public Weddingcompany(Marry target){
            this.target = target;
        }
        @Override
        public void happyMarriage(){
            before();
            this.target.happyMarriage();
            after();
        }
        private void before(){
            System.out.println("布置现场");
        }
        private void after(){
            System.out.println("收尾款");
        }
    }


}
